let mqtt = require('mqtt')
 
let client = mqtt.connect('mqtt://localhost', {
 port: 5112,
 clientId: 'cli_sub',
})
 
client.subscribe('test',{qos:1})
 
client.on('message', function (topic, message) {
 console.log('received message: ', message.toString())
})